import { defineStore } from 'pinia'

export const useCurrentMatchStore = defineStore('currentMatch', 
{
    state: () => {
      return {
        playerList: [
            {
                position:Position.east,
                name:'',
                score:25000
            },
            {
                position:Position.south,
                name:'',
                score:25000
            },
            {
                position:Position.west,
                name:'',
                score:25000
            },
            {
                position:Position.north,
                name:'',
                score:25000
            }
        ] as [MatchPlayer, MatchPlayer, MatchPlayer, MatchPlayer],
        threePerson:false,
        matchLength:"half",
        scoreRule: {
            initialScore: 25000,
            targetScore:30000,
            uma: Uma.tenTwenty,
            oka: true,
            bankruptcy: true,
            enteringWest: true,
            bonusReward: false,
            bonusRewardScore: 2000,
            setScoreSeparate: false
        },
        matchRule: {
            roundUpMangan: false,
            renchan: true,
            readyRenchan: true,
            drawMangan: false,
            drawManganAsRon: false,
            winAndStop: true,
            readyAndStop: true,
            topTakeDeposit: true,
            sameScorePlacement: true,
            noLimit: false
        }
      }
    },
})

export interface MatchPlayer
{
    position: Position,
    name: string,
    score: number
}

export enum Position{
    east = 0,
    south = 1,
    west = 2,
    north = 3
}

export enum Uma{
    fiveTen = "5-10",
    tenFifty = "5-15",
    tenTwenty = "10-20",
    tenThirty = "10-30",
    twentyThirty= "20-30",
}